﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using IN = Criteria.Interface;
using OC = Criteria.OneCriteria;

namespace Criteria.TwoCriteria
{
   public  class AndCriteria:IN.Criteria
    {
       IN.Criteria criteria;
       IN.Criteria otherCriteria;

       public AndCriteria(IN.Criteria criteria,IN.Criteria otherCriteria)
       {
           this.criteria = criteria;
           this.otherCriteria = otherCriteria;
       }

       public List<IN.Person> MeetCriteria(List<IN.Person> list)
       {
           List<IN.Person> firstList = criteria.MeetCriteria(list);
           List<IN.Person> secondList = otherCriteria.MeetCriteria(firstList);
           return secondList;
       }
    }
}
